<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">
    
    <ui:define name="title">
        Password
    </ui:define>

    <ui:define name="description">
        Password component is an extended version of standard inputSecret component with theme integration, strength indicator and match mode.
    </ui:define>

    <ui:param name="documentationLink" value="/components/password"/>
    <ui:param name="widgetLink" value="Password"/>

    <ui:define name="implementation">
        <div class="card">
            <h:form>
                <h5>Basic</h5>
                <p:password id="nonFeedback" value="#{passwordView.password1}"/>
                
                <h5>Feedback</h5>
                <p:password id="feedback" value="#{passwordView.password2}" feedback="true"/>

                <h5>Feedback - Spanish</h5>
                <p:password id="turkishFeedback" value="#{passwordView.password3}" feedback="true"
                            promptLabel="Ingresa tu contraseña" weakLabel="Débil"
                            goodLabel="Buena" strongLabel="Fuerte"/>

                   
                <h5>Inline Feedback</h5>
                <p:password id="inlineFeedback" value="#{passwordView.password5}" feedback="true" inline="true"/>
                
                <h5>Toggle Mask</h5>
                <p:password id="toggle" value="#{passwordView.password6}" toggleMask="true" redisplay="true"/>
            </h:form>
        </div>

        <div class="card">
            <h:form>
                <h5 class="mt-0">Match Passwords</h5>
                <div class="field grid">
                    <p:outputLabel for="pwd1" styleClass="col-fixed" style="width:100px" value="Password"/>
                    <div class="col">
                        <p:password id="pwd1" value="#{passwordView.password5}" match="pwd2" label="Password 1" required="true"/>
                    </div>
                </div>

                <div class="field grid">
                    <p:outputLabel for="pwd2" styleClass="col-fixed" style="width:100px" value="Password"/>
                    <div class="col">
                        <p:password id="pwd2" value="#{passwordView.password5}" label="Password 2" required="true"/>
                    </div>
                </div>

                <p:commandButton update="@form" value="Save"/>

                <p:messages id="messages" showDetail="true">
                    <p:autoUpdate/>
                </p:messages>
            </h:form>
        </div>
    </ui:define>

</ui:composition>
